local chouguo_active = fk.CreateSkill {
  name = "lingling__chouguo_active",
}

Fk:loadTranslationTable{
  ["lingling__chouguo_active"] = "愁国",
}

chouguo_active:addEffect("active", {
  min_card_num = 1,
  target_num = 1,
  expand_pile = function (self, player)
    return self.all_cards
  end,
  card_filter = function(self, player, to_select, selected)
    if table.contains(self.cards, to_select) then
      local total = self.total
      for _, id in ipairs(selected) do
        total = total + Fk:getCardById(id).number
      end
      return total + Fk:getCardById(to_select).number <= 7
    end
  end,
  target_filter = function (self, player, to_select, selected, selected_cards)
    return #selected == 0
  end,
})

return chouguo_active